<?php require_once('../../core/import.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
 	<script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript" src="../../scripts/components/kindeditor/import.kindeditor.js"></script>
    <script type="text/javascript" src="scripts/edit.js"></script>
</head>

<body>
	<?php
    #赋值检测
    if(!is_numeric($ID=Functions::UrlArgs('id'))) exit('信息ID不正确');
    
    #获取数据
    $Data=DB::GetRowByID('$$Fruit',$ID);
    {
	?>
    <form id="Form1" name="Form1" method="post" action="edit.action.php" enctype="multipart/form-data" class="Form">
        <fieldset>
            <legend>水果内容</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
                <td width="50" height="25" align="left">名称：</td>
                <td width="1024" colspan="2">
                    <input type="hidden" id="ID" name="ID" value="<?php echo $Data['ID'];?>" />
                    <input type="text" id="Name" name="Name" maxlength="80" size="100" value="<?php echo $Data['Name'];?>" class="Textbox" />
                </td>
            </tr>
            <tr>
            	<td height="25" align="left" valign="top">描述：</td>
            	<td colspan="2"><textarea id="Description" name="Description" style="width:100%; height:500px;"><?php echo $Data['Description'];?></textarea></td>
            </tr>
            <tr>
            	<td height="25" align="left" valign="middle">果照：</td>
            	<td colspan="2">
                    <input type="File" id="Picture" name="Picture" value="" class="Textbox" /> 
                     <?php
				if($Data['Picture'])
				{
			   ?>
                    <a href="<?php echo Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.$Data['Picture']; ?>" target="_blank">点击查看</a>
                    <?php
				}
			  ?>
                </td>
            </tr>
            </table>
        </fieldset>

        <fieldset>
            <legend>新闻设置</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
                <td width="50" height="25" align="left">类别：</td>
                <td width="1024" colspan="2">
                    <select id="ClassID" name="ClassID">
                        <option value="0">-- 请选择水果类别 --</option>
						<?php                        
                            foreach(DB::GetRows('select ID,Name from $$Fruit_class order by ID asc') as $Row)
                            {
                        ?>                         
	                        <option value="<?php echo $Row['ID'];?>" <?php echo $Data['ClassID']==$Row['ID'] ? 'selected="selected"':'' ?>><?php echo $Row['Name'];?></option>
                        <?php
                            }
						?>
                    </select>                
                </td>
            </tr>
            </table>
        </fieldset>
        <input id="ActionButton" name="ActionButton" type="submit" value="确定" class="button" /> <input id="ResetButton" name="ResetButton" type="reset" value="重置" class="button" />
    </form>
    <?php	
    }
    $Data=NULL;
	?>
</body>
</html>